package com.com.knowledgepaymentmanagementsystem.config;

import com.com.knowledgepaymentmanagementsystem.interceptor.LoginCheckInterceptor;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;


@Configuration//配置类
public class WebConfig implements WebMvcConfigurer {

    @Autowired
    private LoginCheckInterceptor loginCheckInterceptor;

    /**
     * @description: 拦截用户不需要看到的页面
     * @param: registry
     * @return: void
     * @author 张攀
     * @date: 2025/9/25 下午4:57
     */
    @Override
    public void addInterceptors(InterceptorRegistry registry) {
        registry.addInterceptor(loginCheckInterceptor).addPathPatterns("/user/**","/assets/**","/shipping/delete","/shipping/insert","/shipping/update","/goods/delete/{id}","/goods/insert","/goods/update",
                "/photo/delete","/photo/insert","/photo/update",
                "/scene/delete","/scene/insert","/scene/update",
                "/menu/delete","/menu/insert","/menu/update",
                "/group/delete","/group/insert","/group/update",
                "/full/delete","/full/insert","/full/update",
                "/give/delete","/give/insert","/give/update",
                "/seckill/deleteSeckill","/seckill/insertSeckill","/seckill/updateSeckill",
                "/limit/delete","/limit/insert","/limit/update",
                "/video/addVideo","/video/delVideoById","/video/updataVideo",
                "/bill/insert","/bill/delete","/bill/update",
                "/cashback/delete","/cashback/insert","/cashback/update",
                "/column/delete","/column/insert","/column/update",
                "/live/delete","/live/insert","/live/update",
                "/audio/delete","/audio/insert","/audio/update");
    }
}
